A face detection technology refers to a process of determining whether there is a human face in a given image and identifying a location and a range of the human face. Correct face detection can effectively improve face recognition efficiency and speed.
In prior art 1, face detection is mainly performed by using a Haar feature and an Adaboost algorithm. The Haar feature is used to indicate a human face; the Adaboost algorithm is used to select a rectangular frame (weak classifier) of any size and at any location; and the weak classifier is used to form a strong classifier to perform face detection and recognition on an image. The number of Haar features is relatively large in a face detection method of prior art 1; and the Haar features are simple. Therefore, a large number of weak classifiers are required in a sample training process of an image, a feature training process of the image is slow, and training takes a long time.
In prior art 2, face detection is mainly performed by using an Mblbp feature and the Adaboost algorithm. A corresponding weak classifier is selected by calculating an average grayscale value of a specified area of an image sample and calculating a weighted error of classification performed by the weak classifier on the image sample; and the weak classifier is used to form a strong classifier to perform face detection and recognition on an image. Parameters corresponding to a weak classifier in a face detection method of prior art 2 only include a location and a size of a rectangular frame; and a threshold is not included. When an average grayscale value of a training sample is calculated, a comparison value is fixed to 0, which causes poor robustness of the Mblbp feature against noise, a high false detection rate of face detection, and a poor user experience effect of face detection.